package com.yunwaikeji.gy_tool_library.utils;

import android.content.Context;

public class GYBarUtils {
    /**
     * 状态栏高度
     *
     * @param context
     * @return
     */
    public float getStatusBarHeight(Context context) {
        float result = 0;
        int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
        if (resourceId > 0) {
            result = context.getResources().getDimension(resourceId);
        }
        return result;
    }

    /**
     * 导航栏高度
     *
     * @param context
     * @return
     */
    public float getNavigationBarHeight(Context context) {
        float result = 0;
        int resourceId = context.getResources().getIdentifier("navigation_bar_height", "dimen", "android");
        if (resourceId > 0) {
            result = context.getResources().getDimension(resourceId);
        }
        return result;
    }
}
